package com.zwc.common

import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.zwc.core.utils.ToastUtils

/**
 * author:zuoweichen
 * DAte:2023-12-06 14:27
 * Description:BaseActivity 基类默认使用viewBinding
 */
abstract class BaseActivity<V : ViewBinding> : AppCompatActivity() {
    protected lateinit var binding: V
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = createViewBinding(layoutInflater)
        setContentView(binding.root)
        initView()
        initData()
    }

    abstract fun createViewBinding(layoutInflater: LayoutInflater): V
    abstract fun initView()

    abstract fun initData()
}